function foo() {
  console.log(this);
}

foo.call("call"); // this指向call
foo.apply("apply"); // this指向apply

foo.bind("bind")(); // this指向bind

foo.call(undefined);
foo.apply(undefined); // this指向全局对象
foo.bind(undefined)(); // this指向undefined

foo.call(null);
foo.apply(null); // this指向全局对象
foo.bind(null)(); // this指向null
